//
//  StandingsFirstTableViewCell.m
//  EasyToTesco2.0
//
//  Created by 袖手旁觀 on 16/6/21.
//  Copyright © 2016年 EasyToTesco. All rights reserved.
//

#import "StandingsFirstTableViewCell.h"

#define Margin 8

#define FirstCellHeight 64

@implementation StandingsFirstTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self loadCellUI];
        
        NSLog(@"%f",self.contentView.Height);
    }
    return self;
}

- (void)loadCellUI {
    UILabel *firstCell = [[UILabel alloc] init];
    firstCell.text = @"当天增加代金券";
    firstCell.font = [UIFont systemFontOfSize:15];
    firstCell.textAlignment = NSTextAlignmentCenter;
    firstCell.font = [UIFont fontWithName:@ "Arial Rounded MT Bold"  size:(16.0)];
    [self.contentView addSubview:firstCell];
    
    UIView *middleView = [[UIView alloc] init];
    middleView.backgroundColor = [UIColor blackColor];
    middleView.alpha = 0.1;
    [self.contentView addSubview:middleView];
    
    UILabel *secondCell = [[UILabel alloc] init];
    secondCell.text = @"当前代金券";
    secondCell.font = [UIFont systemFontOfSize:15];
    secondCell.font = [UIFont fontWithName:@ "Arial Rounded MT Bold"  size:(16.0)];
    secondCell.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:secondCell];
    
    [firstCell mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.left.equalTo(self.contentView.mas_left).with.offset(Margin);
        make.width.mas_equalTo(self.contentView.width * 0.5 + Margin);
        make.height.mas_equalTo(FirstCellHeight);
    }];

    [middleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView.mas_centerX);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.width.mas_equalTo(1);
        make.height.mas_equalTo(FirstCellHeight - Margin * 3);
    }];
    
    [secondCell mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.left.equalTo(middleView.mas_left).with.offset(Margin);
        make.width.mas_equalTo(self.contentView.width * 0.5 + Margin);
        make.height.mas_equalTo(FirstCellHeight);
    }];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
